home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / server.arc / SERVER.H < prev    next >
Text File  |  1989-11-29  |  2KB  |  59 lines

  1. /*------------------------------------------------* 
  2.  *      Named Pipes server header file            * 
  3.  *                                                * 
  4.  *      Written by: Stephen T. Bunch              * 
  5.  *                  API Development               * 
  6.  *                                                * 
  7.  *      Date:       July 11, 1989                 * 
  8.  *                                                * 
  9.  *------------------------------------------------*/ 
  10.  
  11. #define TLA_SIZE  10 
  12.  
  13. /*  
  14.  * index structure, external array read into RAM upon program boot. 
  15.  * This index list is sorted for easier access  
  16.  */ 
  17. struct INDEX { 
  18.     char tla[TLA_SIZE];/* tla to find expanded form for */ 
  19.     USHORT offset;     /* offset * sizeof(RECORD) == fseek address into record file*/ 
  20. }; 
  21.  
  22.      
  23. /*  
  24.  * record structure, external data file is a list of these structures 
  25.  * does not have to be sorted  
  26.  */ 
  27. struct RECORD { 
  28.     char tla[TLA_SIZE];/* the tla of record, all NULLs means a deleted entry */ 
  29.     USHORT offset;     /* offset of next record with this TLA */ 
  30.     char expanded[80]; /* the expanded tla */ 
  31.     char explain[160]; /* an explaination of the tla, what it is or means */ 
  32. }; 
  33.  
  34.  
  35. /*  
  36.  * communication buffer passed into the server dropin module, how you get  
  37.  * this information from the client is up to the particular program  
  38.  */ 
  39. struct COMMBUFFER { 
  40.     int type;                /* type of communication - see types below */ 
  41.     struct RECORD record;    /* information offered */ 
  42. };  
  43.  
  44.  
  45. /*  
  46.  * Types of requests that come to server, these can be ored '|' together  
  47.  */ 
  48. #define ADD_TO_LIST       0x0001    /* add new tla (future) */ 
  49. #define QUERY             0x0002    /* query to get expanded string only */ 
  50. #define SORT              0x0004    /* sort file and create new index */ 
  51. #define DELETE            0x0008    /* delete this tla from index and file */ 
  52. #define WRITE             0x0010    /* write modified record back to file */ 
  53.  
  54. /*  
  55.  * possible error messages  
  56.  */ 
  57. #define RECORD_NOT_FOUND    200 
  58. #define RECORD_FOUND          0 
  59.